home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8481 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: goanna.cs.rmit.EDU.AU!not-for-mail
  2. From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 19 Feb 1996 17:43:31 +1100
  6. Organization: Comp Sci, RMIT, Melbourne, Australia
  7. Message-ID: <4g966j$cr8@goanna.cs.rmit.EDU.AU>
  8. References: <00001a73+00002504@msn.com> <4etcmm$lpd@nova.dimensional.com> <3114d8fb.5a455349@zesi.ruhr.de> <4f5h5t$f13@vixen.cso.uiuc.edu> <4g1bgf$l5@mailhub.scitec.com.au> <312515DF.7D3B@cmlj.demon.co.uk> <4g5sas$787@goanna.cs.rmit.EDU.AU>
  9. NNTP-Posting-Host: goanna.cs.rmit.edu.au
  10. X-Newsreader: NN version 6.5.0 #0 (NOV)
  11.  
  12. rav@goanna.cs.rmit.EDU.AU (++           robin) writes:
  13. >---It's other things besides -- like, how to find a square root, how to do
  14. >simple I/O.
  15.  
  16. How to do a square root:
  17.  
  18. Step 1 (applies to all programming languages)
  19.     Look up square root in the manual.
  20.  
  21. Step 2 (applies to all programming languages)
  22.     Do what the Fine Manual says.
  23.  
  24. In Ada, use the index, which points you to A.5.1, and do
  25.  
  26.     with Ada.Numeric_Elementary_Functions;
  27.     use  Ada.Numeric_Elementary_Functions;
  28.  
  29.     ...
  30.         sqrt(X)
  31.     ...
  32.  
  33. Section G.2.4 even gives you error bounds on the result, which no other
  34. language standard I've checked does.  Just because of that, I'd rather
  35. do a square root in Ada than anything else.
  36.  
  37. Simple I/O:
  38.  
  39. Step 1
  40.     Look it up in the manual
  41. Step 2
  42.     Do what the Fine Manual says.
  43.  
  44. *SIMPLE* I/O involves withing and using a couple of standard packages,
  45. and then using Put, New_Line, Get, and Skip_Line.  Pretty darned simple.
  46. It has not been a problem for first-year students at this university.
  47.  
  48. Ada does not support Fortran-style formatted I/O, nor PL/I style
  49. formatted or pictured I/O (but see Interfaces.COBOL).
  50.  
  51. -- 
  52. Election time; but how to get Labour _out_ without letting Liberal _in_?
  53. Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
  54.